<template>
  <div id="echarts" />
</template>

<script>
import * as echarts from 'echarts'
export default {
  data() {
    return {

    }
  },

  created() {

  },

  mounted() {
    this.init()
  },

  methods: {
    init() {
      const myChart = echarts.init(document.getElementById('echarts'))
      const option = {
        // backgroundColor: '#161627',
        legend: {
          data: ['平均值', '自己']
        },
        radar: {
          // shape: 'circle',
          indicator: [
            { name: '创新', max: 100 },
            { name: '考勤', max: 100 },
            { name: '绩效', max: 100 },
            { name: '缺勤', max: 100 },
            { name: '产量', max: 100 },
            { name: '评价', max: 100 }
          ],
          axisName: {
            formatter: '【{value}】',
            color: '#ccc'
          }
        },
        series: [
          {
            name: 'Budget vs spending',
            type: 'radar',
            data: [
              {
                value: [50, 20, 70, 30, 100, 70],
                name: '平均值'
              },
              {
                value: [100, 30, 60, 50, 100, 80],
                name: '自己'
              }
            ]
          }
        ]
      }
      // 绘制图表
      myChart.setOption(option)
    }
  }
}
</script>

<style scoped lang='scss'>
#echarts{
  width: 600px;
  height: 400px;
}
</style>
